@include('home.Usercenter.header')

        <!-- ngView: -->
        <div ng-view="" role="main" class="ng-scope">
            <div class="profile-container container" profile-container="" page-title="个人资料"
            page-name="info">
                <div class="clearfix">
                    <div class="location" ng-style="{visibility: geohash ? &#39;&#39; : &#39;hidden&#39;}"
                    role="navigation" location="">
                        <span>
                            当前位置 : {{session('dizhi')}}
                        </span>
                        
                        <span ng-transclude="">

                            <span class="ng-binding ng-scope">
                                个人资料
                            </span>
                        </span>
                    </div>
                    <div search-input="">
                    </div>
                </div>
                @include('home.UserCenter.leftList')
                

                @foreach($users as $k)
                <div class="profile-panel user" role="main">

                    <!-- ngIf: pageTitleVisible -->
                    <h3 ng-if="pageTitleVisible" class="profile-paneltitle ng-scope">
                        <span ng-bind="pageTitle" class="ng-binding">
                            个人资料
                        </span>
                        <span class="subtitle ng-binding" ng-bind-html="pageSubtitle | toTrusted">
                        </span>
                    </h3>

                    <!-- end ngIf: pageTitleVisible -->
                    <div class="profile-panelcontent" ng-transclude="">
                        <div class="profileinfo ng-scope">
                            <p class="profileinfo-item">
                                <span class="profileinfo-label">
                                    头像
                                </span>
                                <span class="profileinfo-face">
                                    <img ng-src="//fuss10.elemecdn.com/1/aa/517c48e40061040af3a2b6a96bf94jpeg.jpeg?imageMogr2/format/webp/quality/85"
                                    alt="{{$k->username}}" src="/home/Usercenters/img/default/{{$k->headpic}}">

                                    <a class="profileinfo-facedit" href="/modify/img">

                                        编辑头像
                                    </a>
                                </span>
                            </p>


                            @if($k->status == 1)

                            <p class="profileinfo-item">
                                <span class="profileinfo-label">
                                    用户名
                                </span>
                                <span>
                                    <span class="profileinfo-value ng-binding" ng-bind="user.username">
                                        {{$k->username}}
                                    </span>
                                    <!-- ngIf: user.is_auto_generated.username -->
                                </span>
                            </p>

                            @else
                            <p class="profileinfo-item" style="width:500px">
                                <span class="profileinfo-label">用户名</span>
                                <span>

                                    <span class="profileinfo-value ng-binding" ng-bind="user.username">{{$k->username}} 
                                    @if($k->auth == 0) 
                                    </span>
                                    
                                    <!-- ngIf: user.is_auto_generated.username -->
                                    <a ng-if="user.is_auto_generated.username" class="profileinfo-link ng-scope" href="javascript:" dialog-trigger="username">[修改]</a>
                                    @else
                                    <a style="display:none" ng-if="user.is_auto_generated.username" class="profileinfo-link ng-scope" href="javascript:" dialog-trigger="username">[修改]</a>
                                    @endif
                                    <!-- end ngIf: user.is_auto_generated.username -->
                                </span>
 
                            </p>

                            @if (count($errors) > 0)
                                        @foreach ($errors->all() as $error)
                            <p class="profileinfo-item" style="width:500px;color:red;">
                                <span class="profileinfo-label">错误信息</span>
                                <span>

                                    <span style="color:red;" class="profileinfo-value ng-binding" ng-bind="user.username"> {{ $error ? $error : (session::get('errors')) }} 
                                    </span>

                            </p>
                               @endforeach
                                    @endif
                                     

                            @endif
                            <div class="dialog checkusername" role="dialog" dialog="username" style="display: none;">
                                
                                <div class="dialog-close icon-close">
                                </div>

                                <div class="dialog-content" ng-transclude="">
                                    <form action="/modify/edituser" method="post" class="modifyname ng-scope ng-pristine ng-valid" ng-submit="">
                                        <h3 class="modifyname-title" style="color:#ffffff;">
                                            修改用户名
                                            <small style="color:#ffffff;">

                                                用户名只能修改一次
                                            </small>
                                        </h3>
                                        <div class="formfield ng-isolate-scope" ng-class="{ &#39;validate-error&#39;: model.$hintTypes[property] === &#39;error&#39; }"
                                        form-field="" model="userData" property="name">
                                            <label ng-bind="label" class="ng-binding">
                                            </label>

                                            {{csrf_field()}}
                                            <input ng-model="userData.name" name="username" placeholder="请输入新的用户名（6-20字符）" class="ng-scope ng-pristine ng-valid">

                                            <div class="formfield-hint">
                                                <span ng-class="{ &#39;icon-dot-error&#39;: model.$hintTypes[property] === &#39;error&#39;, &#39;icon-dot-warning&#39;: model.$hintTypes[property] === &#39;warning&#39; }"
                                                ng-bind="model.$hints[property]" class="ng-binding">
                                                </span>
                                            </div>
                                        </div>
                                        <button class="btn-primary btn-lg">
                                            确定
                                        </button>
                                        <a class="modifyname-cancel" href="/UserCenter/info" style="color:#ffffff;">
                                            取消
                                        </a>
                                    </form>
                                </div>
                            </div>


                            <p class="profileinfo-item">
                                <span class="profileinfo-label">
                                    手机号码
                                </span>
                                <!-- ngIf: user.is_mobile_valid -->
                                <span ng-if="user.is_mobile_valid" class="ng-scope">
                                    <span class="profileinfo-value ng-binding" ng-bind="user.mobile">
                                        {{$k->phone}}
                                    </span>
                                    <a class="profileinfo-link" href="/UserCenter/security">
                                        [修改]
                                    </a>
                                </span>
                                <!-- end ngIf: user.is_mobile_valid -->
                                <!-- ngIf: !user.is_mobile_valid -->
                            @if(empty($k->email))
                            </p>
                            <p class="profileinfo-item">
                                <span class="profileinfo-label">
                                    我的邮箱
                                </span>
                                <!-- ngIf: user.is_email_valid -->
                                <!-- ngIf: !user.is_email_valid -->
                                <span ng-if="!user.is_email_valid" class="ng-scope">
                                    <span class="profileinfo-value unbind">
                                        未绑定
                                    </span>        
                                    <a class="profileinfo-link unbind" href="/UserCenter/security">
                                        [立即绑定]
                                    </a>
                                </span>
                                <!-- end ngIf: !user.is_email_valid -->
                            </p>
                            @else

                            <p class="profileinfo-item"><span class="profileinfo-label">我的邮箱</span> <!-- ngIf: user.is_email_valid --><span ng-if="user.is_email_valid" class="ng-scope"><span class="profileinfo-value ng-binding" ng-bind="user.email">{{$k->email}}</span> <a class="profileinfo-link" href="/UserCenter/security">[修改]</a></span><!-- end ngIf: user.is_email_valid --> <!-- ngIf: !user.is_email_valid --></p>

                            @endif
                            
                        </div>
                    
                    </div>
                </div>
                @endforeach
            </div>
        </div>

        <script>
            $('.profileinfo-link.ng-scope').click(function(){
                $('.dialog.checkusername').css('display','block');
                $('.dialog.checkusername').css('background','#999999');
                $('.dialog.checkusername').css('margin-top','-180px');
                
            });
            $('.dialog-close.icon-close').click(function(){
                $('.dialog.checkusername').css('display','none');

            });

        </script>
       
@include('home.Usercenter.footer')
